
#ifndef GYRO_FLOW_PORT_AFFINE_WARP_H
#define GYRO_FLOW_PORT_AFFINE_WARP_H

typedef struct {
    unsigned char r, g, b;
} RGBPixel;

typedef struct {
    unsigned char y, uv;
} YUV422Pixel;

typedef struct {
    unsigned char y, u, v;
} YUV444Pixel;

void testSrcTgtImg(const char* pic_path);

void testAffineWarpRGB(const char* pic_path);

void testAffineWarpYUV422(const char* file_path);

void testAffineWarpYUV444(const char* file_path);

//仿射矩阵求逆
void pseudoInverse(float* transform_matrix, float* result);

void affineWarpRGBLeftTopNeighbor(RGBPixel* input_image, RGBPixel* output_image, int width, int height, float* transform_matrix);

void affineWarpRGBLeftTopBili(RGBPixel* input_image, RGBPixel* output_image, int width, int height, float* transform_matrix);

void affineWarpRGBCenterBili(RGBPixel* input_image, RGBPixel* output_image, int width, int height, float* transform_matrix);

void affineWarpYUV422LeftTopBili(YUV422Pixel* input_image, YUV422Pixel* output_image, int width, int height, float* transform_matrix);

void affineWarpYUV422CenterBili(YUV422Pixel* input_image, YUV422Pixel* output_image, int width, int height, float* transform_matrix);

void affineWarpYUV422CenterBiliComplex(YUV422Pixel* input_image, YUV422Pixel* output_image, int width, int height, float* transform_matrix);

void affineWarpYUV422CenterNeibor(YUV422Pixel* input_image, YUV422Pixel* output_image, int width, int height, float* transform_matrix);

void affineWarpYUV444LeftTopBili(YUV444Pixel* input_image, YUV444Pixel* output_image, int width, int height, float* transform_matrix);

#endif //GYRO_FLOW_PORT_AFFINE_WARP_H
